﻿// ===============================================================================
// DotNet.Platform 开发框架 2016 版权所有
// ===============================================================================

using System;
using DotNet.Entity;
using System.ComponentModel.DataAnnotations;
using DotNet.DataAnnotationsExtensions;

namespace DotNet.Core.Entity
{
    /// <summary>
    /// 建议反馈
    /// </summary>
    [Table("建议反馈")]    
    public class Feedback
    {
		/// <summary>
        /// 主键
        /// </summary>
        [PrimaryKey]
        [Column("主键",false)]
        public string Id { get; set; }

		/// <summary>
        /// 受理编号
        /// </summary>
		[Column("受理编号")]
        public string Number { get; set; }

		/// <summary>
        /// 信件主题
        /// </summary>
		[Column("信件主题")]
        [Required(ErrorMessage = "请输入信件主题")]
        [MaxLength(150, ErrorMessage = "信件主题长度不能超过{0}个字符")]
        public string Title { get; set; }

		/// <summary>
        /// 信件分类
        /// </summary>
		[Column("信件分类")]
        [MaxLength(50, ErrorMessage = "信件主题长度不能超过{0}个字符")]
        public string Category { get; set; }

		/// <summary>
        /// 姓名
        /// </summary>
		[Column("姓名")]
        [MaxLength(50, ErrorMessage = "信件主题长度不能超过{0}个字符")]
        public string Name { get; set; }

        /// <summary>
        /// 手机号码
        /// </summary>
        [Column("手机号码")]
        [MobilePhone(ErrorMessage = "请输入正确的手机号码")]
        [MaxLength(50, ErrorMessage = "信件主题长度不能超过{0}个字符")]
        public string Tel { get; set; }

		/// <summary>
        /// 邮箱
        /// </summary>
		[Column("邮箱")]
        [Email(ErrorMessage = "请输入正确的电子邮件")]
        [MaxLength(50, ErrorMessage = "信件主题长度不能超过{0}个字符")]
        public string Email { get; set; }

		/// <summary>
        /// 信息内容
        /// </summary>
		[Column("信息内容")]
        [Required(ErrorMessage = "请输入信息内容")]
        public string Contents { get; set; }

		/// <summary>
        /// 状态 0待审核 1 已审核
        /// </summary>
		[Column("状态", Exported = false)]
        public bool Status { get; set; }

        /// <summary>
        /// 状态描述
        /// 0 待审核 1 已审核
        /// </summary>
        [Ignore]
        [Column("状态")]
        public string StatusText
        {
            get
            {
                if (Status == false)
                {
                    return "待审核";
                }
                else if (Status == true)
                {
                    return "已审核";
                }
                return "未知";
            }
        }

        /// <summary>
        /// 受理时间
        /// </summary>
        [Column("受理时间")]
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 回复部门
        /// </summary>
		[Column("回复部门")]
        public string RevertDept { get; set; }

        /// <summary>
        /// 回复时间
        /// </summary>
        [Column("回复时间")]
        public DateTime? RevertTime { get; set; }

        /// <summary>
        /// 回复内容
        /// </summary>
        [Column("回复内容")]
        public string RevertContents { get; set; }

        /// <summary>
        /// 复制对象
        /// </summary>
        public Feedback Clone()
        {
            return (Feedback)MemberwiseClone();
        }
    }
}
